package com.yuan.stream流复习;

import java.util.function.BiConsumer;
import java.util.function.Function;

/*
 *  @author 雨安
 *  类名： StreamDemo2
 *  创建时间：2024/5/15
 */
public class StreamDemo2 {

    public static void main(String[] args) {
        BiConsumer<String,String> biConsumer = (a,b)->{
            System.out.println(a + b);
        };
        //传递两个参数调用BiConsumer
        biConsumer.accept("参数1","参数2");
        //传递一个参数 返回一个整数
        Function<Integer,String> function = (ele)-> ele>0?"成功":"失败";
        //调用方法
        String apply = function.apply(5);
        //打印返回数据
        System.out.println(apply);
        //线程重写
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                System.out.println("这是我的Run方法");
            }
        };
        //调用run方法
        runnable.run();


    }


}
